package com.foreknow.service.impl;

import com.foreknow.dao.EmpDao;
import com.foreknow.dao.impl.EmpDaoImpl;
import com.foreknow.model.Emp;
import com.foreknow.service.EmpService;

public class EmpServiceImpl implements EmpService {

    private EmpDao empDao;

    //set方法的作用：可以给属性初始化
    public void setEmpDao(EmpDao empDao) {
        this.empDao = empDao;
    }

    @Override
    public boolean add(Emp emp) {
      return empDao.add(emp);
    }

    @Override
    public boolean deleteById(int empno) {
        return false;
    }

    @Override
    public Emp[] getQueryAll() {
        return new Emp[0];
    }

    @Override
    public Emp getQueryById(int empno) {
        return null;
    }

    @Override
    public Emp update(Emp emp) {
        return null;
    }

    public static void main(String[] args) {
        EmpService service = new EmpServiceImpl();
        Emp emp = new Emp();
        emp.setEname("tom");
        service.add(emp);
    }
}
